package de.revdev.llt.bean.entities;

import de.revdev.llt.bean.entities.interfaces.EntityInterface;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author f.lindermaier
 */
@Entity
@Table(name = "tbl_learnstatusfc")
public class LearnStatusFC implements Serializable, EntityInterface {

    public enum Status {

        UNKNOWN, WORST, BAD, GOOD, BETTER, BEST
    }
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private int correct;
    private int notcorrect;
    @Enumerated(EnumType.STRING)
    private Status learnCategory;
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastDateAnswered;
    @ManyToOne
    @JoinColumn(name = "id_learnStatusFCB")
    private LearnStatusFCB learnStatusFCB;
    @OneToOne
    private FileCard fileCard;

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public LearnStatusFCB getLearnStatusFCB() {
        return learnStatusFCB;
    }

    public void setLearnStatusFCB(LearnStatusFCB learnStatusFCB) {
        this.learnStatusFCB = learnStatusFCB;
    }

    public FileCard getFileCard() {
        return fileCard;
    }

    public void setFileCard(FileCard fileCard) {
        this.fileCard = fileCard;
    }

    public int getCorrect() {
        return correct;
    }

    public void setCorrect(int correct) {
        this.correct = correct;
    }

    public int getNotcorrect() {
        return notcorrect;
    }

    public void setNotcorrect(int notcorrect) {
        this.notcorrect = notcorrect;
    }

    public Status getLearnCategory() {
        return learnCategory;
    }

    public void setLearnCategory(Status learnCategory) {
        this.learnCategory = learnCategory;
    }

    public Date getLastDateAnswered() {
        return lastDateAnswered;
    }

    public void setLastDateAnswered(Date lastDateAnswered) {
        this.lastDateAnswered = lastDateAnswered;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LearnStatusFC)) {
            return false;
        }
        LearnStatusFC other = (LearnStatusFC) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "de.revdev.llt.bean.entities.LearnStatusFC[ id=" + id + " ]";
    }
}
